﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDebug>
#include <QButtonGroup>
#include <QThread>
#include <QIcon>
#include <QLabel>
#include <QPalette>
#include <QCloseEvent>
#include <QMessageBox>

#include "maindesigner.h"
#include "dataanalyse.h"
#include "systemsetting.h"
#include "serialportservice.h"

#define SSS(R) #R
#define TTT(R) SSS(R)

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void closeEvent(QCloseEvent *event);

signals:
    void sig_SerialOpen(void);
    void sig_SerialClose(void);
    void sig_serialWrite(QByteArray send_data);

private slots:
    void on_tbtn_dataAnalyse_clicked();

private:
    Ui::MainWindow *ui;
    QButtonGroup btn_group;

    MainDesigner *my_maindesigner;
    DataAnalyse *my_dataanalyse;
    SystemSetting *my_systemsetting;

    QLabel *lab_status1 = NULL;
    QLabel *lab_status2 = NULL;
    QLabel *lab_status3 = NULL;

    QThread serial_thread;
    SerialPortService *serial_service;
};
#endif // MAINWINDOW_H
